<?php
$all_items = &$Planet->getItems();
$limit = $PlanetConfig->getMaxDisplay();
$count = 0;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta http-equiv="Content-Script-Type" content="text/javascript" />
	<meta http-equiv="Content-Style-Type" content="text/css" />
	
	<title><?php echo $PlanetConfig->getName(); ?></title>
	<?php include(dirname(__FILE__).'/head.tpl.php'); ?>
</head>

<body>
    <div id="page">
        <?php include(dirname(__FILE__).'/top.tpl.php'); ?>
        
        <div id="content">
            <?php foreach ($all_items as $item): ?>
                <div class="post">
                    <h2 class="post-title"><a href="<?php echo $item->getUrl(); ?>" title="Go to original place"><?php echo $item->getTitle(); ?></a></h2>
                    <p class="post-info">
                        <?php echo $item->getAuthor(); ?>, 
                        <?php 
                        $ago = time() - $item->getDate();
                        echo '<span title="'.Duration::toString($ago).' ago">'.date('d/m/Y', $item->getDate()).'</span>';
                        ?> | 
                        <?php $owner = $item->getOwner(); ?>
                        <a href="<?php echo $owner->getWebsite(); ?>"><?php echo $owner->getName(); ?></a>
                    </p>
                    <div class="post-content">
                        <?php echo $item->getContent(); ?>
                    </div>
                </div>
                <?php if (++$count == $limit) { break; } ?>
            <?php endforeach; ?>
        </div>
        
        <?php include_once(dirname(__FILE__).'/sidebar.tpl.php'); ?>
        
        <?php include(dirname(__FILE__).'/footer.tpl.php'); ?>
    </div>
</body>
</html>